<template>
    <div>
<h2>注册</h2>
<table>
    <tr>
        <td>账号</td>
        <td>
           <input type="text" v-model="start.Lname"/>
        </td>
    </tr>
    <tr>
        <td>密码</td>
        <td><input type="text" v-model="start.Lpwd" />
        </td>
    </tr>
    <tr>
        <td><input type="button" value="注册" @click="logins" /></td>
        <td></td>
    </tr>
</table>
    </div>
</template>

<script setup lang="ts">


import {reactive,toRefs,onMounted} from 'vue'
import {useRouter,useRoute} from 'vue-router'
import axios from 'axios'
const router = useRouter()
const route = useRoute()

let data=reactive({
    start:{
        Lname:'',
        Lpwd:''
    }
})
let {start}=toRefs(data)

const logins=()=>{
  let obj={
    Lname:start.value.Lname,
    Lpwd:start.value.Lpwd,
  }
  console.log(obj)
  axios({
    url:'https://localhost:7144/api/Login/Logins',
    method:'get',
    params:obj
  })
  .then((res)=>{
    if(res.data.list==null)
    {
        alert('用户不存在')
        return;
    }
    else
    {
        alert('成功')
        return;
    }
  })
  .catch((err)=>{
    console.log(err)
  })
}




</script>

<style scoped>

</style>